<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
<meta charset="utf-8" />
<title>E:first-line/E::first-line</title>
<meta name="description" content="CSS3参考手册之: E:first-line/E::first-line" />
<meta name="keywords" content="E:first-line, E::first-line, css3选择符, css3, css3参考手册" />
<meta name="author" content="Joy Du(飘零雾雨), dooyoe@gmail.com, www.doyoe.com" />
<meta name="robots" content="all" />
<!--[if lte IE 8]>
<script src="../../js/html5.js"></script>
<![endif]-->
<link rel="stylesheet" href="../../skin/article.css" />
</head>
<body>
<nav id="guide" class="g-mod">
	<div class="from">
		<a href="http://css.doyoe.com/" target="_blank">CSS3参考手册</a>
		<span>&#187;</span>
		<a href="../index.htm">选择符列表</a>
		<span>&#187;</span>
		<a href="index.htm" id="category" rel="selectors/pseudo-element" name="first-line">伪对象选择符</a>
		<span>&#187;</span>
	</div>
	<div class="to">
		<span class="label">相关内容：</span>
		<div class="g-combobox g-transition">
			<a href="?" class="g-transition target">
				<strong>其它伪对象选择符</strong>
				<span>选择其它项<!--[if lte IE 7]><ins>IE7 and earlier, Get to die</ins><![endif]--></span>
			</a>
			<div class="g-transition list">
				<ul>
					<!-- 插入分类快速导航 -->
				</ul>
			</div>
		</div>
	</div>
</nav>
<header id="hd">
	<section id="title" class="g-mod">
		<h1 class="tit">E:first-line/E::first-line</h1>
		<ul class="info">
			<li><strong>版本：CSS1/3</strong></li>
		</ul>
		<!-- 插入浏览器信息 -->
	</section>
</header>
<section id="bd">
	<section id="syntax" class="g-mod g-attr">
		<h2 class="tit">语法：</h2>
		<div class="cont">
			<p><strong>E:first-line/E::first-line</strong> { sRules }</p>
		</div>
	</section>
	<section id="intro" class="g-mod g-attr">
		<h2 class="tit">说明：</h2>
		<div class="cont">
			<strong>设置对象内的第一行的样式。</strong>
			<ul>
				<li>此伪对象仅作用于块对象。内联对象要使用该伪对象，必须先将其设置为块级对象。</li>
				<li>IE6在使用该选择符时有个显式的BUG：<em class="g-color-light">选择符与包含规则的花括号之间不能紧挨着，需留有空格或换行</em>。同时还存在该BUG的选择符包括：<a href="first-letter.htm">E:first-letter</a></li>
				<li>
					<p>CSS3将伪对象选择符(Pseudo-Element Selectors)前面的<em class="g-color-light">单个冒号(:)修改为双冒号(::)</em>用以区别伪类选择符(Pseudo-Classes Selectors)，但以前的写法仍然有效。</p>
					<p>即E:first-line可转化为E::first-line</p>
				</li>
			</ul>
		</div>
	</section>
	<section id="compatible" class="g-mod g-attr">
		<h2 class="tit">兼容性：</h2>
		<div class="cont">
			<ul class="support-type">
				<li><span class="support">浅绿</span> = 支持</li>
				<li><span class="unsupport">红色</span> = 不支持</li>
				<li><span class="partsupport">粉色</span> = 部分支持</li>
			</ul>
			<table class="g-data">
				<thead>
					<tr>
						<th>Selector</th>
						<th>IE</th>
						<th>Firefox</th>
						<th>Chrome</th>
						<th>Safari</th>
						<th>Opera</th>
						<th>iOS Safari</th>
						<th>Android Browser</th>
						<th>Android Chrome</th>
					</tr>
				</thead>
				<tbody>
					<tr>
						<td rowspan="2"><strong>Basic Support</strong></td>
						<td class="partsupport">6.0 <sup><a href="#support1">#1</a></sup></td>
						<td class="support" rowspan="5">2.0+</td>
						<td class="support" rowspan="5">4.0+</td>
						<td class="support" rowspan="5">3.1+</td>
						<td class="support" rowspan="5">3.5+</td>
						<td class="support" rowspan="5">3.2+</td>
						<td class="support" rowspan="5">2.1+</td>
						<td class="support" rowspan="5">18.0+</td>
					</tr>
					<tr>
						<td class="support">7.0+</td>
					</tr>
					<tr>
						<td rowspan="4">::first-letter</td>
						<td class="unsupport">6.0</td>
					</tr>
					<tr>
						<td class="partsupport">7.0-8.0 <sup><a href="#support2">#2</a></sup></td>
					</tr>
					<tr>
						<td class="support">9.0+</td>
					</tr>
				</tbody>
			</table>
			<ol class="support-info">
				<li id="support1">E:first-line选择符不能紧挨着规则集大括号，需留有空格或换行。</li>
				<li id="support2">本质上并不支持伪元素的双冒号(::)写法，而是忽略掉了其中的一个冒号，仍以单冒号来解析，所以等同变相支持了E::first-line。</li>
			</ol>
		</div>
	</section>
	<section id="example" class="g-mod g-attr">
		<h2 class="tit">示例：</h2>
		<div class="cont">
			<textarea cols="90" rows="10">
<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
<meta charset="utf-8" />
<title>E::first-line_CSS参考手册_web前端开发参考手册系列</title>
<meta name="author" content="Joy Du(飘零雾雨), dooyoe@gmail.com, www.doyoe.com" />
<style>
h1{font-size:16px;}
p{width:200px;padding:5px 10px;border:1px solid #ddd;font:14px/1.5 simsun,serif,sans-serif;}
p:first-line {color:#090;}
p::first-line {color:#090;}
</style>
</head>
<body>
<h1>第一行文字的颜色与其它不同</h1>
<p>今天，阳光明媚，晴空万里，非常适合户外活动，如踏青、远足之类的。长期坐在办公室的同学们要多注意运动。</p>
</body>
</html>
			</textarea>
			<p><input type="button" value="运行" class="g-btn g-btn-sure" /></p>
		</div>
	</section>
</section>
<footer id="ft">
	<aside id="rights" class="g-mod">
		<!-- 插入浏览器及版权信息 -->
	</aside>
</footer>
<script src="../../js/jquery.js"></script>
<script src="../../js/inner.js"></script>
</body>
</html>